<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!-- 글 입력 후 refresh 하면 글이 다시 입력 되는 것을 막기 위해 session scope에 write_form.jsp에서 특정한 값을 속성으로 넣어 보낸다. -->
<c:set var="from_form" scope="session" value="no_refresh"/>
        
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>글수정폼</title>
<script type="text/javascript">
function check(){
	var form = document.getElementById("form1");
	if(!form.title.value){
		alert("제목을 입력하세요.");
		form.title.focus();
		return false;
	}
	if(!form.writer.value){
		alert("작성자를 입력하세요.");
		form.writer.focus();
		return false;
	}
	if(!form.content.value){
		alert("내용을 입력하세요.");
		form.writer.focus();
		return false;
	}
}
</script>
<style type="text/css">
.all_tag{
	width:650px;
	border-bottom:1px;
	border-left:1px;
	border-right:1px;
	border-top:1px;
	border-style:solid;
	border-color:#CF3131;
	background-color: #FFD8D8;
	font-family:verdana;
	font-size:11pt;
	font-weight:bold;
	color:#CF3131;
}
.btn{
	color:#CF3131;   
	font: bold 84% 'trebuchet ms',helvetica,sans-serif;   
	background-color:#fed;   
	border:1px solid;   
	border-color: #CF3131; 
	cursor:pointer;
}
</style>
</head>
<body>
<!-- 
1. 입력 폼 - 글제목, 작성자, 글내용
2. javascript 이용해서 입력폼에 글이 입력되었는지 체크
 -->
 <center><div class="all_tag">
 <br>
 <b>글수정</b><p/>
<form action="modifyContent.do" method="post" id="form1" onsubmit="return check()">
<input type="hidden" name="no" value="${requestScope.bto.no }">
<table width="550px">
 <tr>
	<td width="100px" align="center">제&nbsp;&nbsp;&nbsp;목</td>
	<td><input type="text" name="title" size="50" value="${requestScope.bto.title }" maxlength="20"></td>
 </tr>
 <tr>
	<td align="center">작성자</td>
	<td><input type="text" name="writer" size="50" value="${requestScope.bto.writer }" maxlength="10"></td>
 </tr>
 <tr>
	<td colspan=2>
		<textarea cols="75" rows="15" name="content" maxlength="200"/>
${requestScope.bto.content }
</textarea>
	</td>
 </tr>
 <tr>
 	<td colspan="2" align="center">
	 	<input type="submit" value="수정완료" class="btn">
	 	<input type="reset" value="초기화" class="btn">
	 </td>
 </tr>
 </table>
 </form>
 <br>
 </div></center>
</body>
</html>







